package routers

import (
	beego "github.com/beego/beego/v2/server/web"
	"github.com/beego/beego/v2/server/web/context"
)

func init() {

	// 1.get请求
	beego.Get("/getMethod", func(ctx *context.Context) {
		ctx.Output.Body([]byte("基础路由之get请求"))
	})

	// 2.post请求
	beego.Post("/postMethod", func(ctx *context.Context) {
		ctx.ResponseWriter.Write([]byte("基础路由之post请求"))
	})

	// 3.put请求
	beego.Put("/putMethod", func(ctx *context.Context) {
		ctx.Output.Body([]byte("基础路由之put请求"))
	})

	// 4.patch请求
	beego.Patch("/patchMethod", func(ctx *context.Context) {
		ctx.ResponseWriter.Write([]byte("基础路由之patch请求"))
	})

	// 5.delete请求
	beego.Delete("/deleteMethod", func(ctx *context.Context) {
		ctx.ResponseWriter.Write([]byte("基础路由之delete请求"))
	})

	// 6.head请求
	beego.Head("/headMethod", func(ctx *context.Context) {
		ctx.ResponseWriter.Write([]byte("基础路由之head请求"))
	})

	// 7.options请求
	beego.Options("/optionsMethod", func(ctx *context.Context) {
		ctx.ResponseWriter.Write([]byte("基础路由之options请求"))
	})

}
